<?php

namespace App\Service;

use App\Model\AuthMenu;
use App\Model\AuthUser;

class AdminAuthService extends BaseService
{

    public function getAuthMenuByUid($uid)
    {
        $adminInfo = AuthUser::where(['id' => $uid, 'status' => 1])->first();

        // 超管返回所有不受角色组控制
        if ($adminInfo['super_admin'] == 1 ){

            $menuList = AuthMenu::getAllMenuList();

        }else{

            $menuList = AuthMenu::getMenuListByGroup($adminInfo['admin_group_id']);
        }
        return $menuList;


    }

}